home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection 1998 Fall: Game Toolkit / Disc.iso / SDKs / QuickTime Mac / PInterfaces / QD3DDrawContext.p < prev    next >
Encoding:
Text File  |  1998-04-09  |  12.3 KB  |  301 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        QD3DDrawContext.p
  3.  
  4.      Contains:    Draw context class types and routines                               
  5.  
  6.      Version:    Technology:    Quickdraw 3D 1.5.4
  7.                  Release:    QuickTime 3.0
  8.  
  9.      Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT QD3DDrawContext;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __QD3DDRAWCONTEXT__}
  28. {$SETC __QD3DDRAWCONTEXT__ := 1}
  29.  
  30. {$I+}
  31. {$SETC QD3DDrawContextIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __QD3D__}
  35. {$I QD3D.p}
  36. {$ENDC}
  37.  
  38. {$IFC TARGET_OS_MAC }
  39. {$IFC UNDEFINED __QUICKDRAW__}
  40. {$I Quickdraw.p}
  41. {$ENDC}
  42. {$IFC UNDEFINED __FIXMATH__}
  43. {$I FixMath.p}
  44. {$ENDC}
  45. {$IFC UNDEFINED __GXTYPES__}
  46. {$I GXTypes.p}
  47. {$ENDC}
  48. {$ENDC}  {TARGET_OS_MAC}
  49.  
  50.  
  51. {$PUSH}
  52. {$ALIGN POWER}
  53. {$LibExport+}
  54.  
  55. {*****************************************************************************
  56.  **                                                                             **
  57.  **                            DrawContext Data Structures                         **
  58.  **                                                                             **
  59.  ****************************************************************************}
  60.  
  61. TYPE
  62.     TQ3DrawContextClearImageMethod  = LONGINT;
  63. CONST
  64.     kQ3ClearMethodNone            = {TQ3DrawContextClearImageMethod}0;
  65.     kQ3ClearMethodWithColor        = {TQ3DrawContextClearImageMethod}1;
  66.  
  67.  
  68.  
  69. TYPE
  70.     TQ3DrawContextDataPtr = ^TQ3DrawContextData;
  71.     TQ3DrawContextData = RECORD
  72.         clearImageMethod:        TQ3DrawContextClearImageMethod;
  73.         clearImageColor:        TQ3ColorARGB;
  74.         pane:                    TQ3Area;
  75.         paneState:                TQ3Boolean;
  76.         mask:                    TQ3Bitmap;
  77.         maskState:                TQ3Boolean;
  78.         doubleBufferState:        TQ3Boolean;
  79.     END;
  80.  
  81. {*****************************************************************************
  82.  **                                                                             **
  83.  **                                DrawContext Routines                         **
  84.  **                                                                             **
  85.  ****************************************************************************}
  86. FUNCTION Q3DrawContext_GetType(drawContext: TQ3DrawContextObject): TQ3ObjectType; C;
  87. FUNCTION Q3DrawContext_SetData(context: TQ3DrawContextObject; {CONST}VAR contextData: TQ3DrawContextData): TQ3Status; C;
  88. FUNCTION Q3DrawContext_GetData(context: TQ3DrawContextObject; VAR contextData: TQ3DrawContextData): TQ3Status; C;
  89. FUNCTION Q3DrawContext_SetClearImageColor(context: TQ3DrawContextObject; {CONST}VAR color: TQ3ColorARGB): TQ3Status; C;
  90. FUNCTION Q3DrawContext_GetClearImageColor(context: TQ3DrawContextObject; VAR color: TQ3ColorARGB): TQ3Status; C;
  91. FUNCTION Q3DrawContext_SetPane(context: TQ3DrawContextObject; {CONST}VAR pane: TQ3Area): TQ3Status; C;
  92. FUNCTION Q3DrawContext_GetPane(context: TQ3DrawContextObject; VAR pane: TQ3Area): TQ3Status; C;
  93. FUNCTION Q3DrawContext_SetPaneState(context: TQ3DrawContextObject; state: TQ3Boolean): TQ3Status; C;
  94. FUNCTION Q3DrawContext_GetPaneState(context: TQ3DrawContextObject; VAR state: TQ3Boolean): TQ3Status; C;
  95. FUNCTION Q3DrawContext_SetClearImageMethod(context: TQ3DrawContextObject; method: TQ3DrawContextClearImageMethod): TQ3Status; C;
  96. FUNCTION Q3DrawContext_GetClearImageMethod(context: TQ3DrawContextObject; VAR method: TQ3DrawContextClearImageMethod): TQ3Status; C;
  97. FUNCTION Q3DrawContext_SetMask(context: TQ3DrawContextObject; {CONST}VAR mask: TQ3Bitmap): TQ3Status; C;
  98. FUNCTION Q3DrawContext_GetMask(context: TQ3DrawContextObject; VAR mask: TQ3Bitmap): TQ3Status; C;
  99. FUNCTION Q3DrawContext_SetMaskState(context: TQ3DrawContextObject; state: TQ3Boolean): TQ3Status; C;
  100. FUNCTION Q3DrawContext_GetMaskState(context: TQ3DrawContextObject; VAR state: TQ3Boolean): TQ3Status; C;
  101. FUNCTION Q3DrawContext_SetDoubleBufferState(context: TQ3DrawContextObject; state: TQ3Boolean): TQ3Status; C;
  102. FUNCTION Q3DrawContext_GetDoubleBufferState(context: TQ3DrawContextObject; VAR state: TQ3Boolean): TQ3Status; C;
  103.  
  104. {*****************************************************************************
  105.  **                                                                             **
  106.  **                            Pixmap Data Structure                             **
  107.  **                                                                             **
  108.  ****************************************************************************}
  109.  
  110. TYPE
  111.     TQ3PixmapDrawContextDataPtr = ^TQ3PixmapDrawContextData;
  112.     TQ3PixmapDrawContextData = RECORD
  113.         drawContextData:        TQ3DrawContextData;
  114.         pixmap:                    TQ3Pixmap;
  115.     END;
  116.  
  117. {*****************************************************************************
  118.  **                                                                             **
  119.  **                        Pixmap DrawContext Routines                             **
  120.  **                                                                             **
  121.  ****************************************************************************}
  122. FUNCTION Q3PixmapDrawContext_New({CONST}VAR contextData: TQ3PixmapDrawContextData): TQ3DrawContextObject; C;
  123. FUNCTION Q3PixmapDrawContext_SetPixmap(drawContext: TQ3DrawContextObject; {CONST}VAR pixmap: TQ3Pixmap): TQ3Status; C;
  124. FUNCTION Q3PixmapDrawContext_GetPixmap(drawContext: TQ3DrawContextObject; VAR pixmap: TQ3Pixmap): TQ3Status; C;
  125.  
  126.  
  127. {$IFC TARGET_OS_MAC }
  128. {*****************************************************************************
  129.  **                                                                             **
  130.  **                        Macintosh DrawContext Data Structures                 **
  131.  **                                                                             **
  132.  ****************************************************************************}
  133.  
  134. TYPE
  135.     TQ3MacDrawContext2DLibrary     = LONGINT;
  136. CONST
  137.     kQ3Mac2DLibraryNone            = {TQ3MacDrawContext2DLibrary}0;
  138.     kQ3Mac2DLibraryQuickDraw    = {TQ3MacDrawContext2DLibrary}1;
  139.     kQ3Mac2DLibraryQuickDrawGX    = {TQ3MacDrawContext2DLibrary}2;
  140.  
  141.  
  142.  
  143. TYPE
  144.     TQ3MacDrawContextDataPtr = ^TQ3MacDrawContextData;
  145.     TQ3MacDrawContextData = RECORD
  146.         drawContextData:        TQ3DrawContextData;
  147.         window:                    CWindowPtr;
  148.         library:                TQ3MacDrawContext2DLibrary;
  149.         viewPort:                gxViewPort;
  150.         grafPort:                CGrafPtr;
  151.     END;
  152.  
  153. {*****************************************************************************
  154.  **                                                                             **
  155.  **                        Macintosh DrawContext Routines                         **
  156.  **                                                                             **
  157.  ****************************************************************************}
  158. FUNCTION Q3MacDrawContext_New({CONST}VAR drawContextData: TQ3MacDrawContextData): TQ3DrawContextObject; C;
  159. FUNCTION Q3MacDrawContext_SetWindow(drawContext: TQ3DrawContextObject; window: CWindowPtr): TQ3Status; C;
  160. FUNCTION Q3MacDrawContext_GetWindow(drawContext: TQ3DrawContextObject; VAR window: CWindowPtr): TQ3Status; C;
  161. FUNCTION Q3MacDrawContext_SetGXViewPort(drawContext: TQ3DrawContextObject; viewPort: gxViewPort): TQ3Status; C;
  162. FUNCTION Q3MacDrawContext_GetGXViewPort(drawContext: TQ3DrawContextObject; VAR viewPort: gxViewPort): TQ3Status; C;
  163. FUNCTION Q3MacDrawContext_SetGrafPort(drawContext: TQ3DrawContextObject; grafPort: CGrafPtr): TQ3Status; C;
  164. FUNCTION Q3MacDrawContext_GetGrafPort(drawContext: TQ3DrawContextObject; VAR grafPort: CGrafPtr): TQ3Status; C;
  165. FUNCTION Q3MacDrawContext_Set2DLibrary(drawContext: TQ3DrawContextObject; library: TQ3MacDrawContext2DLibrary): TQ3Status; C;
  166. FUNCTION Q3MacDrawContext_Get2DLibrary(drawContext: TQ3DrawContextObject; VAR library: TQ3MacDrawContext2DLibrary): TQ3Status; C;
  167. {$ENDC}  {TARGET_OS_MAC}
  168.  
  169. {$IFC TARGET_OS_UNIX }
  170. {*****************************************************************************
  171.  **                                                                             **
  172.  **                        X/Windows DrawContext Data Structures                 **
  173.  **                                                                             **
  174.  ****************************************************************************}
  175.  
  176. TYPE
  177.     TQ3XBufferObject = ^LONGINT;
  178.     TQ3XColormapDataPtr = ^TQ3XColormapData;
  179.     TQ3XColormapData = RECORD
  180.         baseEntry:                LONGINT;
  181.         maxRed:                    LONGINT;
  182.         maxGreen:                LONGINT;
  183.         maxBlue:                LONGINT;
  184.         multRed:                LONGINT;
  185.         multGreen:                LONGINT;
  186.         multBlue:                LONGINT;
  187.     END;
  188.  
  189.     TQ3XDrawContextDataPtr = ^TQ3XDrawContextData;
  190.     TQ3XDrawContextData = RECORD
  191.         contextData:            TQ3DrawContextData;
  192.         display:                DisplayPtr;
  193.         drawable:                Drawable;
  194.         visual:                    VisualPtr;
  195.         cmap:                    Colormap;
  196.         colorMapData:            TQ3XColormapDataPtr;
  197.     END;
  198.  
  199. {*****************************************************************************
  200.  **                                                                             **
  201.  **                        X/Windows DrawContext Routines                         **
  202.  **                                                                             **
  203.  ****************************************************************************}
  204. {$IFC NOT UNDEFINED XDC_OLD }
  205. FUNCTION Q3XDrawContext_New: TQ3DrawContextObject; C;
  206. PROCEDURE Q3XDrawContext_Set(drawContext: TQ3DrawContextObject; flag: UInt32; data: UNIV Ptr); C;
  207. PROCEDURE Q3XDrawContext_Get(drawContext: TQ3DrawContextObject; flag: UInt32; data: UNIV Ptr); C;
  208. {$ENDC}
  209. FUNCTION Q3XBuffers_New(VAR dpy: Display; numBuffers: UInt32; window: Window): TQ3XBufferObject; C;
  210. PROCEDURE Q3XBuffers_Swap(VAR dpy: Display; buffers: TQ3XBufferObject); C;
  211. FUNCTION Q3X_GetVisualInfo(VAR dpy: Display; VAR screen: Screen): XVisualInfoPtr; C;
  212.  
  213. FUNCTION Q3XDrawContext_New({CONST}VAR xContextData: TQ3XDrawContextData): TQ3DrawContextObject; C;
  214. FUNCTION Q3XDrawContext_SetDisplay(drawContext: TQ3DrawContextObject; {CONST}VAR display: Display): TQ3Status; C;
  215. FUNCTION Q3XDrawContext_GetDisplay(drawContext: TQ3DrawContextObject; VAR display: DisplayPtr): TQ3Status; C;
  216. FUNCTION Q3XDrawContext_SetDrawable(drawContext: TQ3DrawContextObject; drawable: Drawable): TQ3Status; C;
  217. FUNCTION Q3XDrawContext_GetDrawable(drawContext: TQ3DrawContextObject; VAR drawable: Drawable): TQ3Status; C;
  218. FUNCTION Q3XDrawContext_SetVisual(drawContext: TQ3DrawContextObject; {CONST}VAR visual: Visual): TQ3Status; C;
  219. FUNCTION Q3XDrawContext_GetVisual(drawContext: TQ3DrawContextObject; VAR visual: VisualPtr): TQ3Status; C;
  220. FUNCTION Q3XDrawContext_SetColormap(drawContext: TQ3DrawContextObject; colormap: Colormap): TQ3Status; C;
  221. FUNCTION Q3XDrawContext_GetColormap(drawContext: TQ3DrawContextObject; VAR colormap: Colormap): TQ3Status; C;
  222. FUNCTION Q3XDrawContext_SetColormapData(drawContext: TQ3DrawContextObject; {CONST}VAR colormapData: TQ3XColormapData): TQ3Status; C;
  223. FUNCTION Q3XDrawContext_GetColormapData(drawContext: TQ3DrawContextObject; VAR colormapData: TQ3XColormapData): TQ3Status; C;
  224. {$ENDC}  {TARGET_OS_UNIX}
  225.  
  226. {$IFC TARGET_OS_WIN32 }
  227. {*****************************************************************************
  228.  **                                                                             **
  229.  **                         Win32 DrawContext Data Structures                      **
  230.  **                                                                             **
  231.  ****************************************************************************}
  232.  
  233. TYPE
  234.     TQ3Win32DCDrawContextDataPtr = ^TQ3Win32DCDrawContextData;
  235.     TQ3Win32DCDrawContextData = RECORD
  236.         drawContextData:        TQ3DrawContextData;
  237.         _hdc:                    HDC;
  238.     END;
  239.  
  240. {$IFC NOT NOT UNDEFINED QD3D_NO_DIRECTDRAW }
  241.     TQ3DirectDrawObjectSelector  = LONGINT;
  242. CONST
  243.     kQ3DirectDrawObject            = {TQ3DirectDrawObjectSelector}1;
  244.     kQ3DirectDrawObject2        = {TQ3DirectDrawObjectSelector}2;
  245.  
  246.  
  247. TYPE
  248.     TQ3DirectDrawSurfaceSelector  = LONGINT;
  249. CONST
  250.     kQ3DirectDrawSurface        = {TQ3DirectDrawSurfaceSelector}1;
  251.     kQ3DirectDrawSurface2        = {TQ3DirectDrawSurfaceSelector}2;
  252.  
  253.  
  254. TYPE
  255.     TQ3DDSurfaceDescriptorPtr = ^TQ3DDSurfaceDescriptor;
  256.     TQ3DDSurfaceDescriptor = RECORD
  257.         objectSelector:            TQ3DirectDrawObjectSelector;
  258.         filler:                    ARRAY [0..3] OF LONGINT;
  259.     END;
  260.  
  261.     TQ3DDSurfaceDrawContextDataPtr = ^TQ3DDSurfaceDrawContextData;
  262.     TQ3DDSurfaceDrawContextData = RECORD
  263.         drawContextData:        TQ3DrawContextData;
  264.         ddSurfaceDescriptor:    TQ3DDSurfaceDescriptor;
  265.     END;
  266.  
  267. {$ENDC}
  268. {*****************************************************************************
  269.  **                                                                             **
  270.  **                            Win32DC DrawContext Routines                     **
  271.  **                                                                             **
  272.  ****************************************************************************}
  273. FUNCTION Q3Win32DCDrawContext_New({CONST}VAR drawContextData: TQ3Win32DCDrawContextData): TQ3DrawContextObject; C;
  274. FUNCTION Q3Win32DCDrawContext_SetDC(drawContext: TQ3DrawContextObject; newHDC: HDC): TQ3Status; C;
  275. FUNCTION Q3Win32DCDrawContext_GetDC(drawContext: TQ3DrawContextObject; VAR curHDC: HDC): TQ3Status; C;
  276. {*****************************************************************************
  277.  **                                                                             **
  278.  **                            DDSurface DrawContext Routines                     **
  279.  **                                                                             **
  280.  ****************************************************************************}
  281. {$IFC NOT NOT UNDEFINED QD3D_NO_DIRECTDRAW }
  282. FUNCTION Q3DDSurfaceDrawContext_New({CONST}VAR drawContextData: TQ3DDSurfaceDrawContextData): TQ3DrawContextObject; C;
  283. FUNCTION Q3DDSurfaceDrawContext_SetDirectDrawSurface(drawContext: TQ3DrawContextObject; {CONST}VAR ddSurfaceDescriptor: TQ3DDSurfaceDescriptor): TQ3Status; C;
  284. FUNCTION Q3DDSurfaceDrawContext_GetDirectDrawSurface(drawContext: TQ3DrawContextObject; VAR ddSurfaceDescriptor: TQ3DDSurfaceDescriptor): TQ3Status; C;
  285. {$ENDC}
  286. {$ENDC}  {TARGET_OS_WIN32}
  287.  
  288.  
  289.  
  290.  
  291. {$ALIGN RESET}
  292. {$POP}
  293.  
  294. {$SETC UsingIncludes := QD3DDrawContextIncludes}
  295.  
  296. {$ENDC} {__QD3DDRAWCONTEXT__}
  297.  
  298. {$IFC NOT UsingIncludes}
  299.  END.
  300. {$ENDC}
  301.